from mongoengine import Document, IntField, DateTimeField
import datetime


# 在MongoDB数据库中存储用户浏览课程的时间信息
class UserCourseView(Document):
    user_id = IntField(required=True)
    exam_id = IntField()
    work_id = IntField()
    # 浏览时长
    view_time = IntField(required=True)
    # 浏览日期
    date = DateTimeField(default=datetime.datetime.now)
